﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SeizyUtils.Common.Data.Database.Parse
{
    class ReadState : IParseState
    {

        public IParseState ReadLine(string line, StringBuilder resultSql, QueryParam param)
        {
            if (line.StartsWith("[where start]"))
            {
                return new WhereState();
            }
            else if (line.StartsWith("[having start]"))
            {
                return new HavingState();
            }
            else if (line.StartsWith("[set start]"))
            {
                return new SetState();
            }
            resultSql.Append("\n");
            resultSql.Append(QueryParser.replaceParam(line, param));
            return this;
        }

    }
}
